#pragma once

#include <QtCore/QTimer>
#include <QtGui/QFrame>
#include <QtGui/QListWidget>
#include <QtGui/QPushButton>
#include "MikinolSensorManager.h"

namespace Mikinol
{

class QSensorManagerWidget : public QFrame,
							 public SensorManager::Listener
{ 
	Q_OBJECT

public:
	QSensorManagerWidget( QWidget* parent, SensorManager* sensorManager );
	virtual ~QSensorManagerWidget();

protected:
	virtual void				onSensorAdded( SensorManager* sensorManager, Sensor* sensor );
	virtual void				onSensorRemoving( SensorManager* sensorManager, Sensor* sensor );
	virtual void				onSensorRemoved( SensorManager* sensorManager, Sensor* sensor );

	void						updateSensorListWidget();

private slots:
	void						onTimerTimeOut();
	void						startStopButtonPressed();

private:
	SensorManager*				mSensorManager;
	QTimer*						mTimer;
	QListWidget*				mSensorListWidget;
	QPushButton*				mStartStopButton;
};

}
